<template>
  <!-- if you want automatic padding use "layout-padding" class -->
  <div class="layout-padding">
    <!-- your content-->
    <div>
     <q-input v-model="Nop" placeholder="期数"></q-input>
    </div>

    <div class="cold">
      <q-input  v-model="Se" placeholder="特别码">,</q-input></div>
       <div class="cold">
      <q-input  v-model="D1" placeholder="">,</q-input></div>
      <div class="cold">
      <q-input  v-model="D2" placeholder="">,</q-input></div>
      <div class="cold">
      <q-input  v-model="D3" placeholder="">,</q-input></div>
      <div class="cold">
      <q-input  v-model="D4" placeholder="">,</q-input></div>
      <div class="cold">
      <q-input  v-model="D5" placeholder="">,</q-input></div>
      <div class="cold">
      <q-input  v-model="D6" placeholder="">,</q-input></div>
      <div class="cold">
      <q-input  v-model="D7" placeholder=""></q-input></div>
    
    
     
    <div>
      <q-btn class="push" color="blue" @click="save">保存</q-btn>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
import {
    dom,
    event,
    openURL,
    QLayout,
    QToolbar,
    QToolbarTitle,
    QBtn,
    QInput,
    QIcon,
    QList,
    QListHeader,
    QItem,
    QItemSide,
    QItemMain,
    QCollapsible,
    QTransition,
    QSideLink,
    Dialog
  } from 'quasar'
  import {
    mavonEditor
  } from 'mavon-editor'
  export default {
      components: {
      QLayout,
      QToolbar,
      QToolbarTitle,
      QBtn,
      QInput,
      QIcon,
      QList,
      QListHeader,
      QItem,
      QItemSide,
      QItemMain,
      QCollapsible,
      QTransition,
      mavonEditor,
      QSideLink
    },
    data() {
      return {
          ID:0,
          Nop:'',
          Se:'',
          D1: '',
          D2: '',
          D3: '',
          D4: '',
          D5: '',
          D6: '',
          D7: ''
          
      }
    },
    methods:{
   save() {
            var self = this
            axios.post('/addnum', {
                id: this.ID,
                nop: this.Nop,
                se: this.Se,
                d1: this.D1,
                d2: this.D2,
                d3: this.D3,
                d4: this.D4,
                d5: this.D5,
                d6: this.D6,
                d7: this.D7
                
                
            })
                .then(function (response) {
                    var rt = response.data
                    if (rt.success) {
                        self.close()
                        self.refresh()
                         self.$toast.success({
                            title: '成功了',
                            message: '保存成功'
                        })
                    } else {
                        self.$toast.error({
                            title: '出错了',
                            message: rt.rt
                        })
                    }
                })
                .catch(function (error) {
                    self.$toast.error({
                        title: '出错了',
                        message: '出现未知错误!'
                    })
                })
        }
    }
  }
</script>

<style lang="stylus">
.push
  width 80px
  margin-top 12px
.cold
  width 50px 
  display inline-flex
</style>
